package spittr.data;

import com.sun.org.apache.bcel.internal.generic.LNEG;
import org.springframework.stereotype.Component;
import spittr.Spittle;
import sun.security.provider.ConfigFile;

import java.util.Date;
import java.util.LinkedList;
import java.util.List;

/**
 * SpittleRepository实现类
 * 其实Test里边并没有调用这个方法，
 *      测试方法里直接用Mockito.when().thenReturn()的方式对SpittleRepository接口的findSpittles方法进行了返回，详见shouldShowRecentSpittles()方法
 */
@Component
public class SpittleRepositoryImpl implements SpittleRepository {
    @Override
    public List<Spittle> findSpittles(long max, int count) {
        List<Spittle> result = new LinkedList<>();
        return result;
    }

    @Override
    public Spittle findOneSpittle(long spittleId) {
        Spittle spittle = new Spittle("Ini", new Date());
        return spittle;
    }

    @Override
    public Spittle save(Spittle param1) {
        Spittle spittle = new Spittle("Ini", new Date());
        return spittle;
    }

}
